package com.example.javaairportflightanalysis.controller;

import com.example.javaairportflightanalysis.common.ApiRestResponse;
import com.example.javaairportflightanalysis.domin.information.EventFlight;
import com.example.javaairportflightanalysis.domin.information.FlightNumberGroupDtime;
import com.example.javaairportflightanalysis.service.InformationService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author shen
 */
@RestController
@RequestMapping("/information")
public class InformationController {
    @Resource
    InformationService informationService;
    @GetMapping("/flightnumberA2")
    public ApiRestResponse selectFlightA2() {
        List<FlightNumberGroupDtime> flightNumberGroupDtimeList = informationService.selectFlightNumberA2();

        return ApiRestResponse.success(flightNumberGroupDtimeList);
    }
    @GetMapping("/flightnumberA3")
    public ApiRestResponse selectFlightA3() {
        List<FlightNumberGroupDtime> flightNumberGroupDtimeList = informationService.selectFlightNumberA3();
        return ApiRestResponse.success(flightNumberGroupDtimeList);
    }
    @GetMapping("/flightnumberD2")
    public ApiRestResponse selectFlightD2() {
        List<FlightNumberGroupDtime> flightNumberGroupDtimeList = informationService.selectFlightNumberD2();
        return ApiRestResponse.success(flightNumberGroupDtimeList);
    }
    @GetMapping("/flightnumberD3")
    public ApiRestResponse selectFlightD3() {
        List<FlightNumberGroupDtime> flightNumberGroupDtimeList = informationService.selectFlightNumberD3();
        return ApiRestResponse.success(flightNumberGroupDtimeList);
    }


    @GetMapping("/eventflightA2")
    public ApiRestResponse eventFlightA2() {
        List<EventFlight> eventFlights = informationService.selectEventFlightA2();
        return ApiRestResponse.success(eventFlights);
    }
    @GetMapping("/eventflightA3")
    public ApiRestResponse eventFlightA3() {
        List<EventFlight> eventFlights = informationService.selectEventFlightA3();
        return ApiRestResponse.success(eventFlights);
    }
    @GetMapping("/eventflightD2")
    public ApiRestResponse eventFlightD2() {
        List<EventFlight> eventFlights = informationService.selectEventFlightD2();
        return ApiRestResponse.success(eventFlights);
    }
    @GetMapping("/eventflightD3")
    public ApiRestResponse eventFlightD3() {
        List<EventFlight> eventFlights = informationService.selectEventFlightD3();
        return ApiRestResponse.success(eventFlights);
    }



}
